package com.jn.erp.wechat.staff.api.controller;

import com.jn.erp.common.core.result.AjaxResult;
import com.jn.erp.web.api.interaction.service.TEvaluateService;
import com.jn.erp.wechat.common.api.controller.base.BaseWxAuthController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <pre>
 *
 * </pre>
 *
 * @author sunjiyong
 * @since 2024/12/6 10:54
 */
@RestController
@RequestMapping("/wx/obsStorage")
public class MpObsController extends BaseWxAuthController {



    @Autowired
    private TEvaluateService tEvaluateService;


    /**
     * 上传文件  /obsStorage/upload
     * @param file
     * @return
     */
    @PostMapping("/upload")
    public AjaxResult upload(List<MultipartFile> file){
        List<String> url = tEvaluateService.upload(file);
        return AjaxResult.success(url);
    }

    /**
     * 删除上传文件   /obsStorage/delete
     */

    @PostMapping("/delete")
    public AjaxResult delete(@RequestBody List<String> url){
        tEvaluateService.delete(url);
        return AjaxResult.success("删除成功");
    }

}
